// JavaScript Document
/**
 * js用到的一些常量
 *
 * @type {{
 *      BASE_PATH: string,
 *      IMG_BASE_URL: string,
 *      SEARCHBOX_DEF_VALUE: string,
 *      SELECT_DATE: string,
 *      SELECT_START_DATE: string,
 *      SELECT_END_DATE: string,
 *      WRITE_ASK: string,
 *      WRITE_ASK_DETAIL: string,
 *      WRITE_SHARE: string,
 *      WRITE_SHARE_DETAIL: string, I
 *      S_SHARE: boolean
 *}}
 */
var Constans = {
    BASE_PATH: "net_url/",
    IMG_BASE_URL: "../images/",
    SEARCHBOX_DEF_VALUE: "搜人/问题/话题/活动",
    SELECT_DATE: "请选择日期",
    SELECT_START_DATE: "请选择开始日期",
    SELECT_END_DATE: "请选择结束日期",
    WRITE_ASK: "有什么疑难问题困惑着你？提出来，百位圈内名人帮你解答",
    WRITE_ASK_DETAIL: "<label style=\"color:#555555;font-size:14px;\">写下你的问题补充，让圈友更容易理解你的问题...</label>",
    WRITE_SHARE: "发现了有意思的好东西？赶紧分享给大家吧",
    WRITE_SHARE_DETAIL: "<label style=\"color:#555555;font-size:14px;\">更精彩的描述你的分享，加图片、加表情、加文档，通通都可以</label>",
    IS_SHARE: (window.location.href.indexOf("/share/") >= 0) || (window.location.href.indexOf("fetchShareInfo") >= 0)
};

var Constants = Constans;

/**
 * 电子圈非查询动作
 *
 * @type {{
 *      FOLLOW: string,
 *      VOTE: string,
 *      ANS_QUESTION: string,
 *      ASK_QUESTION: string,
 *      ASK_TO: string,
 *      COMMENT_QUESTION: string,
 *      COMMENT_ANSWER: string,
 *      COMMENT_PARTY: string,
 *      INVITE_JOIN: string,
 *      INVITE_ANS: string,
 *      SHARE_SITE: string,
 *      SHARE_EMAIL: string,
 *      SHARE_WEIBO: string,
 *      PUSH_PARTY: string,
 *      JOIN_PARTY: string,
 *      REQ_FRIEND: string,
 *      PRI_LETTER: string,
 *      PUSH_SHARE: string,
 *      REPORT: string,
 *      getAllAuths: Function
 *}}
 */
var DZQ_ACTIONS = {
    FOLLOW: 'FOLLOW',//关注
    VOTE: 'VOTE',//投票
    ANS_QUESTION: 'ANS_QUESTION',//回答问题
    ASK_QUESTION: 'ASK_QUESTION',//提问,添加问题
    ASK_TO: 'ASK_TO',//向谁提问
    COMMENT_QUESTION: 'COMMENT_QUESTION',//评论问题
    COMMENT_ANSWER: 'COMMENT_ANSWER',//评论问题
    COMMENT_PARTY: 'COMMENT_PARTY',//评论活动
    INVITE_JOIN: 'INVITE_JOIN',//邀请加入电子圈
    INVITE_ANS: 'INVITE_ANS',//邀请回答
    SHARE_SITE: 'SHARE_SITE',//圈内分享
    SHARE_EMAIL: 'SHARE_EMAIL',//邮件分享
    SHARE_WEIBO: 'SHARE_WEIBO',//微博分享
    PUSH_PARTY: 'CREATE_PARTY',//创建活动
    JOIN_PARTY: 'JOIN_PARTY',//申请加入活动
    REQ_FRIEND: 'REQ_FRIEND',//请求加好友
    PRI_LETTER: 'PRI_LETTER',//发私信
    PUSH_SHARE: 'PUSH_SHARE',//发布分享
    REPORT: 'REPORT',//举报
    getAllAuths: function () {
        var arr = [];
        for (var file in this) {
            if (typeof(this[file]) == 'string') {
                arr.push(this[file]);
            }
        }
        return arr;
    }
};

/**
 * 电子圈权限
 *
 * @type {{
 *      UNVAL_EMAIL_AUTHS: Array,
 *      ALL_AUTHS: Array
 *}}
 */
var DZQ_AUTH = {
    //未验证/没有邮箱时的可用权限
    UNVAL_EMAIL_AUTHS: [DZQ_ACTIONS.SHARE_EMAIL,
        DZQ_ACTIONS.SHARE_WEIBO,
        DZQ_ACTIONS.SHARE_SITE],
    ALL_AUTHS: [DZQ_ACTIONS.getAllAuths()]
};